<script src='<?php echo base_url; ?>admin/product/jquery.MultiFile.js' type="text/javascript" language="javascript"></script>
<?php
$product_name = $product_type = $country_id = $price = $laboratory = $product_description = $product_keywords = "";
?>
<div class="heading">
    <h1><img src="<?php echo base_url; ?>admin/templates/image/product.png" alt="" /> 
        <?php echo $lang['PRODUCT']; ?>&nbsp;&nbsp;&nbsp;<span class="required">(*) all asterisks must be required!</span>
    </h1>
    <div class="buttons">
        <input class="button" type="submit" name="btnsubmit" value="<?php echo $lang['PUBLISH']; ?>" onclick="checkSellerform();" />
        <input class="button" type="button" value="<?php echo $lang['CANCEL']; ?>" onclick="window.location.href = 'index.php'" />
    </div>
</div>

<div class="content">
    <?php if (isset($_GET['error'])) { ?>
        <div class="warning">Fields are required!</div>
    <?php } ?>
    <?php if (isset($_GET['errorexist'])) { ?>
        <div class="warning">Product name is already existing!</div>
    <?php } ?>
    <div class="wrap-tabs">	
        <input type="hidden" name="hidid" value="<?php echo @$id; ?>" />
        <div id="tabs" class="htabs">
            <a href="#tab-general"><?php echo $lang['PRODUCT']; ?><span class="required">*</span></a>
            <a href="#tab-data"><?php echo $lang['MENU_CATEGORY']; ?><span class="required">*</span></a>
            <a href="#tap-contact-detail">Contact Information</a>
        </div>
        <div id="tab-general">
            <table class="form">
                <tr>
                    <td><?php echo $lang['PRO_NAME']; ?><span class="required">*</span></td>
                    <td><input required="required" type="text" name="new_proname" size="100" value="<?php
                        echo stripslashes($product_name);
                        echo @$_SESSION['ProductName'] ? @$_SESSION['ProductName'] : ''
                        ?>" /></td>                        
                </tr>
                <tr>
                    <td><?php echo 'Description'; ?><span class="required">*</span></td>
                    <td><textarea name="txtdesc" style="height: 100px; margin: 0px 2px; width: 634px;" required="required"><?php
                            echo stripslashes($product_description);
                            echo @$_SESSION['description'] ? @$_SESSION['description'] : ''
                            ?></textarea></td>
                </tr>
                <tr>
                    <td><?php echo $lang['CON_PRO_KEYWORD']; ?> </td>
                    <td><textarea name="txtkeywords" rows="5" cols="100"><?php
                            echo stripslashes($product_keywords);
                            echo @$_SESSION['KeyWord'] ? @$_SESSION['KeyWord'] : ''
                            ?></textarea></td>
                </tr>
                <tr>
                    <td><?php echo $lang['IMG']; ?></td>
                    <td>
                        <div id="uploadimage"><input id="field_1" type="file" name="imagefile[]" size="35"/></div>
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <div id="morefield"></div>
                        <div id="addfield" class="tablectrl_small bDefault" style="cursor: pointer;"><img src="<?php echo base_url; ?>templates/image/addmore.png"/></div>
                    </td>
                </tr>

            </table>
        </div>

        <div id="tab-data">
            <table class="form">
                <tr>
                    <td> <?php echo $lang['PRICE']; ?><span class="required">*</span></td>
                    <td>
                        <input type="hidden" name="selectCoun[]" value="38"  />
                        <input required="required" type="text" class="pricenumber" name="price[]" value="<?php echo @$_SESSION['Price'] ? @$_SESSION['Price'] : ''; ?>" class="txtprice" />
                    </td>
                </tr>
                <tr>
                    <td> <?php echo $lang['CON_PRO_VERSION']; ?><span class="required">*</span></td>
                    <td>
                        <select name="selectProductVersion" >
                            <?php @$version = $_SESSION['Condition'] ? $_SESSION['Condition'] : '' ?>
                            <option value="0" <?php
                                    if ($version == 0) {
                                        echo 'selected="selected"';
                                    }
                                    ?>><?php echo $lang['CON_PRO_VERSION_NEW']; ?></option>
                            <option value="1"  <?php
                                    if ($version == 1) {
                                        echo 'selected="selected"';
                                    }
                                    ?>><?php echo $lang['CON_PRO_VERSION_USED']; ?></option>
                        </select>
                    </td>
                </tr>
                <tr>
                <tr>
                    <td colspan="2">
<?php
include(S_ROOT . '/includefiles/category.php');
?>
                    </td>
                </tr>
            </table>
        </div>
        <?php
        /* user data */
        $where_user = array(
            Tbluser::id => $_SESSION['acc_id']
        );
        $user_data = select(Tbluser::Tbluser, '', $where_user);
        $result = mysql_fetch_array($user_data);
        /* end user data */
        ?>
        <div id="tap-contact-detail">
            <table class="form">
                <tr>
                    <td>Name:</td>
                    <td>
                        <input type="text" name="txtname" value="<?php echo $result[Tbluser::first_name] . ' ' . $result[Tbluser::last_name]; ?>" class="txtname" />
                    </td>
                </tr>
                <tr>
                    <td>Email:</td>
                    <td>
                        <input type="text" name="txtemail" value="<?php echo $result[Tbluser::email]; ?>" class="txtemail" required="required" />
                    </td>
                    </td>
                </tr>
                <tr>
                <tr>
                    <td>Telephone:</td>
                    <td>
                        <input type="text" name="txttelephone" value="<?php echo $result[Tbluser::mobile]; ?>" class="txttelephone" />
                    </td>
                </tr>
                <tr>
                    <td>Address:</td>
                    <td>
                        <input type="text" name="txtaddress" value="<?php echo $result[Tbluser::address]; ?>" class="txtaddress" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
